<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateFornecedorTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateFornecedorLabel_idFornecedor}" for="idFornecedor" />
                    <h:inputText id="idFornecedor" value="#{fornecedorController.selected.idFornecedor}" title="#{bundle.CreateFornecedorTitle_idFornecedor}" required="true" requiredMessage="#{bundle.CreateFornecedorRequiredMessage_idFornecedor}"/>
                    <h:outputLabel value="#{bundle.CreateFornecedorLabel_nome}" for="nome" />
                    <h:inputText id="nome" value="#{fornecedorController.selected.nome}" title="#{bundle.CreateFornecedorTitle_nome}" required="true" requiredMessage="#{bundle.CreateFornecedorRequiredMessage_nome}"/>
                    <h:outputLabel value="#{bundle.CreateFornecedorLabel_telefone}" for="telefone" />
                    <h:inputText id="telefone" value="#{fornecedorController.selected.telefone}" title="#{bundle.CreateFornecedorTitle_telefone}" required="true" requiredMessage="#{bundle.CreateFornecedorRequiredMessage_telefone}"/>
                    <h:outputLabel value="#{bundle.CreateFornecedorLabel_fax}" for="fax" />
                    <h:inputText id="fax" value="#{fornecedorController.selected.fax}" title="#{bundle.CreateFornecedorTitle_fax}" required="true" requiredMessage="#{bundle.CreateFornecedorRequiredMessage_fax}"/>
                    <h:outputLabel value="#{bundle.CreateFornecedorLabel_morada}" for="morada" />
                    <h:inputText id="morada" value="#{fornecedorController.selected.morada}" title="#{bundle.CreateFornecedorTitle_morada}" required="true" requiredMessage="#{bundle.CreateFornecedorRequiredMessage_morada}"/>
                    <h:outputLabel value="#{bundle.CreateFornecedorLabel_fkMunicipio}" for="fkMunicipio" />
                    <h:selectOneMenu id="fkMunicipio" value="#{fornecedorController.selected.fkMunicipio}" title="#{bundle.CreateFornecedorTitle_fkMunicipio}" required="true" requiredMessage="#{bundle.CreateFornecedorRequiredMessage_fkMunicipio}">
                        <f:selectItems value="#{municipioController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{fornecedorController.create}" value="#{bundle.CreateFornecedorSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{fornecedorController.prepareList}" value="#{bundle.CreateFornecedorShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateFornecedorIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
